Skip to content

Conversation

@EvgeniiMunin
Copy link
Contributor

@EvgeniiMunin EvgeniiMunin commented Feb 5, 2025

🔧 Type of changes

  • new bid adapter
  • bid adapter update
  • new feature
  • new analytics adapter
  • new module
  • module update
  • bugfix
  • documentation
  • configuration
  • dependency update
  • tech debt (test coverage, refactorings, etc.)

✨ What's the context?

We want to populate the appliedTo field in the analytics tag and change the structure of analytics results to one imp per result. The example of the modified analytics tag results is as follows:

"results": [
  {
    "status": "success",
    "values": {
      "pub_banniere_haute": {
        "greenbids": {
          "fingerprint": "dd151fbe-38f5-440e-a72d-17810ed8bb9e",
          "keptInAuction": {
            "improvedigital": true,
            "appnexus": true,
            "pubmatic": true,
            "rubicon": true,
            "teads": true
          },
          "isExploration": false
        },
        "tid": "e4e1f086-085b-4ecc-aadc-630d023c1ca2"
      }
    },
    "appliedTo": {
      "impIds": [
        "pub_banniere_haute"
      ],
      "bidders": null
      "request": false,
      "response": false,
      "bidIds": null
    }
  },
  {
    "status": "success",
    "values": {
      "pub_native_web_atf1": {
        "greenbids": {
          "fingerprint": "dd151fbe-38f5-440e-a72d-17810ed8bb9e",
          "keptInAuction": {
            "improvedigital": true,
            "appnexus": true,
            "pubmatic": true,
            "rubicon": true,
            "teads": true
          },
          "isExploration": false
        },
        "tid": "6ca816dd-acbb-4d09-9799-516eeacfe033"
      }
    },
    "appliedTo": {
      "impIds": [
        "pub_native_web_atf1"
      ],
      "bidders": null
      "request": false,
      "response": false,
      "bidIds": null
    }
  }
]

🧠 Rationale behind the change

Why did you choose to make these changes? Were there any trade-offs you had to consider?

🔎 New Bid Adapter Checklist

  • verify email contact works
  • NO fully dynamic hostnames
  • geographic host parameters are NOT required
  • direct use of HTTP is prohibited - implement an existing Bidder interface that will do all the job
  • if the ORTB is just forwarded to the endpoint, use the generic adapter - define the new adapter as the alias of the generic adapter
  • cover an adapter configuration with an integration test

🧪 Test plan

The changes are also reflected in the unit tests:

  • GreenbidsAnalyticsReporterTest
  • GreenbidsRealTimeDataProcessedAuctionRequestHookTest

🏎 Quality check

  • Are your changes following our code style guidelines?
  • Are there any breaking changes in your code?
  • Does your test coverage exceed 90%?
  • Are there any erroneous console logs, debuggers or leftover code in your changes?

@EvgeniiMunin EvgeniiMunin changed the title Greenbids: Populate AppliedTo in Analytics Tag Greenbids: Populate AppliedTo and change structure of analytics results in Analytics Tag Feb 5, 2025
@EvgeniiMunin EvgeniiMunin marked this pull request as ready for review February 5, 2025 18:02
AntoxaAntoxic
AntoxaAntoxic previously approved these changes Feb 7, 2025
AntoxaAntoxic
AntoxaAntoxic previously approved these changes Feb 18, 2025
Comment on lines +72 to +73
private boolean isImpKept(Imp imp, Map<String, Map<String, Boolean>> impsBiddersFilterMap) {
return impsBiddersFilterMap.get(imp.getId()).values().stream().anyMatch(isKept -> isKept);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that it is time for us to change the structure from Map<String, Map<String, Boolean>> to Map<String, Set<String>> impIdToKeptBidders (from the moment of creation in the processProbabilities method).

This is only a suggestion, it is not necessary to change it now.

Comment on lines 35 to 37
final List<Imp> updatedImps = updateImps(bidRequest, impsBiddersFilterMap);

final BidRequest updatedBidRequest = (isExploration || updatedImps.isEmpty())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there is a potential bug with such implementation. You need to update bidRequest that provided in payloadUpdate(payload), so you don't miss updates from other modules in same group on same stage.

@CTMBNara CTMBNara merged commit 274a778 into prebid:master Feb 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants